home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / bin / gtk-config < prev    next >
Text File  |  2005-10-18  |  2KB  |  113 lines

  1. #!/bin/sh
  2.  
  3. glib_libs="-L/usr/lib -rdynamic -lgmodule -lglib"
  4. glib_cflags="-I/usr/include/glib-1.2 -I/usr/lib/glib/include"
  5. glib_thread_libs="-L/usr/lib -rdynamic -lgmodule -lgthread -lglib -lpthread"
  6. glib_thread_cflags="-I/usr/include/glib-1.2 -I/usr/lib/glib/include -D_REENTRANT"
  7.  
  8. prefix=/usr
  9. exec_prefix=${prefix}
  10. exec_prefix_set=no
  11.  
  12. usage()
  13. {
  14.     cat <<EOF
  15. Usage: gtk-config [OPTIONS] [LIBRARIES]
  16. Options:
  17.     [--prefix[=DIR]]
  18.     [--exec-prefix[=DIR]]
  19.     [--version]
  20.     [--libs]
  21.     [--cflags]
  22. Libraries:
  23.     gtk
  24.     gthread
  25. EOF
  26.     exit $1
  27. }
  28.  
  29. if test $# -eq 0; then
  30.     usage 1 1>&2
  31. fi
  32.  
  33. lib_gtk=yes
  34.  
  35. while test $# -gt 0; do
  36.   case "$1" in
  37.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  38.   *) optarg= ;;
  39.   esac
  40.  
  41.   case $1 in
  42.     --prefix=*)
  43.       prefix=$optarg
  44.       if test $exec_prefix_set = no ; then
  45.         exec_prefix=$optarg
  46.       fi
  47.       ;;
  48.     --prefix)
  49.       echo_prefix=yes
  50.       ;;
  51.     --exec-prefix=*)
  52.       exec_prefix=$optarg
  53.       exec_prefix_set=yes
  54.       ;;
  55.     --exec-prefix)
  56.       echo_exec_prefix=yes
  57.       ;;
  58.     --version)
  59.       echo 1.2.10
  60.       ;;
  61.     --cflags)
  62.       echo_cflags=yes
  63.       ;;
  64.     --libs)
  65.       echo_libs=yes
  66.       ;;
  67.     gtk)
  68.       lib_gtk=yes
  69.       ;;
  70.     gthread)
  71.       lib_gthread=yes
  72.       ;;
  73.     *)
  74.       usage 1 1>&2
  75.       ;;
  76.   esac
  77.   shift
  78. done
  79.  
  80. if test "$echo_prefix" = "yes"; then
  81.     echo $prefix
  82. fi
  83.  
  84. if test "$echo_exec_prefix" = "yes"; then
  85.     echo $exec_prefix
  86. fi
  87.  
  88. if test "$lib_gthread" = "yes"; then
  89.       glib_cflags="$glib_thread_cflags"
  90.       glib_libs="$glib_thread_libs"
  91. fi
  92.  
  93. if test "$echo_cflags" = "yes"; then
  94.       echo -I${prefix}/include/gtk-1.2 $glib_cflags  
  95. fi
  96.  
  97. if test "$echo_libs" = "yes"; then
  98.       my_glib_libs=
  99.       libdirs=-L${exec_prefix}/lib
  100.       for i in $glib_libs ; do
  101.         if test $i != -L${exec_prefix}/lib ; then
  102.           if test -z "$my_glib_libs" ; then
  103.             my_glib_libs="$i"
  104.           else
  105.             my_glib_libs="$my_glib_libs $i"
  106.           fi
  107.         fi
  108.       done
  109.  
  110.       echo $libdirs   -lgtk -lgdk $my_glib_libs  -lXi -lXext -lX11   -lm
  111. fi      
  112.  
  113.